<?php
header("Content-Type:text/html;charset=UTF-8");
$xml = '<sence name="新千年" zipname="djSceneData.zip" >
	<subsence name="时尚迪厅"  xmlfile="djScene2.xml" jpg="2361" >
		<control name="特效一" luafile="sencecontrol1"/>
		<control name="特效二" luafile="sencecontrol2"/>
	</subsence>
	<subsence name="春晚" xmlfile="djSceneChun.xml" jpg="2362">
		<control name="特效三" luafile="sencecontrol3"/>
		<control name="特效四" luafile="sencecontrol4"/>
	</subsence>
</sence>';
//$obj = simplexml_load_string($xml);

$xmlstr = '<?xml version="1.0" encoding="utf-8"?><sence></sence>';
$sxe = new SimpleXMLElement($xmlstr);
$sxe->addAttribute('name', '新千年');
$sxe->addAttribute('zipname', 'djSceneData.zip');


$movie = $sxe->addChild('subsence');
$movie->addAttribute('name', '时尚迪厅');
$movie->addAttribute('xmlfile', 'djScene2.xml');
$movie->addAttribute('jpg', '2361');

$contrl = $movie->addChild('control');
$contrl->addAttribute('name', '特效一');
$contrl->addAttribute('luafile', 'sencecontrol1');

$contrl = $movie->addChild('control');
$contrl->addAttribute('name', '特效二');
$contrl->addAttribute('luafile', 'sencecontrol2');



$movie = $sxe->addChild('subsence');
$movie->addAttribute('name', '春晚');
$movie->addAttribute('xmlfile', 'djSceneChun.xml');
$movie->addAttribute('jpg', '2362');

$contrl = $movie->addChild('control');
$contrl->addAttribute('name', '特效三');
$contrl->addAttribute('luafile', 'sencecontrol3');

$contrl = $movie->addChild('control');
$contrl->addAttribute('name', '特效四');
$contrl->addAttribute('luafile', 'sencecontrol4');


$xml = simplexml_load_string( $sxe->asXML() );
foreach( $xml->attributes() as $k=>$v){
	echo '<br />'.$k.' - '.$v;
}



$d = 'D:/xampp/htdocs\sdq\scene\2010\02\kkyoo-ld-UxoV0tNZKuJfLokp.zip';
var_dump( preg_split('/(scene\\.*)/', $d, -1, PREG_SPLIT_NO_EMPTY)    );



//$_ =& $GLOBALS;
$GLOBALS['dadsasda'] = "ADFHJGJKKRTGAFAREGTRHS";
echo '<hr/>'.count($GLOBALS);
/*
foreach($GLOBALS as $k=>$v){
	echo $k.'<hr/>';
	var_dump($v);
}
*/
echo substr('1002', 0, 3);

?>